<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: fabgl::Keyboard::begin</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classfabgl_1_1_keyboard_a4f1c6a36aae1c88e57c6bc7e05c772d1.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a id="a4f1c6a36aae1c88e57c6bc7e05c772d1" name="a4f1c6a36aae1c88e57c6bc7e05c772d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f1c6a36aae1c88e57c6bc7e05c772d1">&#9670;&nbsp;</a></span>begin() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void begin </td>
          <td>(</td>
          <td class="paramtype">gpio_num_t&#160;</td>
          <td class="paramname"><em>clkGPIO</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">gpio_num_t&#160;</td>
          <td class="paramname"><em>dataGPIO</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>generateVirtualKeys</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>createVKQueue</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes <a class="el" href="classfabgl_1_1_keyboard.html" title="The PS2 Keyboard controller class.">Keyboard</a> specifying CLOCK and DATA GPIOs. </p>
<p >A reset command (<a class="el" href="classfabgl_1_1_keyboard_a50910ef42a65d4c139af341f1ef2323f.html#a50910ef42a65d4c139af341f1ef2323f" title="Sends a Reset command to the keyboard.">Keyboard.reset()</a> method) is automatically sent to the keyboard.<br  />
 This method also initializes the <a class="el" href="classfabgl_1_1_p_s2_controller.html" title="The PS2 device controller class.">PS2Controller</a> to use port 0 only.</p>
<p >Because PS/2 ports are handled by the ULP processor, just few GPIO ports are actually usable. They are: GPIO_NUM_2, GPIO_NUM_4, GPIO_NUM_12 (with some limitations), GPIO_NUM_13, GPIO_NUM_14, GPIO_NUM_15, GPIO_NUM_25, GPIO_NUM_26, GPIO_NUM_27, GPIO_NUM_32 and GPIO_NUM_33.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">clkGPIO</td><td>The GPIO number of Clock line </td></tr>
    <tr><td class="paramname">dataGPIO</td><td>The GPIO number of Data line </td></tr>
    <tr><td class="paramname">generateVirtualKeys</td><td>If true creates a task which consumes scancodes to produce virtual keys, so you can call <a class="el" href="classfabgl_1_1_keyboard_ad64abdda7b0ab92e15e23c602571e851.html#ad64abdda7b0ab92e15e23c602571e851" title="Gets the virtual keys status.">Keyboard.isVKDown()</a>. </td></tr>
    <tr><td class="paramname">createVKQueue</td><td>If true creates a task which consunes scancodes and produces virtual keys and put them in a queue, so you can call <a class="el" href="classfabgl_1_1_keyboard_ad64abdda7b0ab92e15e23c602571e851.html#ad64abdda7b0ab92e15e23c602571e851" title="Gets the virtual keys status.">Keyboard.isVKDown()</a>, <a class="el" href="classfabgl_1_1_keyboard_a1da2800c551ac4fa0fe2f61915a8a2da.html#a1da2800c551ac4fa0fe2f61915a8a2da" title="Gets the number of virtual keys available in the queue.">Keyboard.virtualKeyAvailable()</a> and <a class="el" href="classfabgl_1_1_keyboard_a0de31f752f76a296060bc792b51e50ba.html#a0de31f752f76a296060bc792b51e50ba" title="Gets a virtual key from the queue.">Keyboard.getNextVirtualKey()</a>.</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><pre class="fragment">// Setup pins GPIO33 for CLK and GPIO32 for DATA
Keyboard.begin(GPIO_NUM_33, GPIO_NUM_32);  // clk, dat
</pre> 
<p class="definition">Definition at line <a class="el" href="keyboard_8cpp_source.html#l00092">92</a> of file <a class="el" href="keyboard_8cpp_source.html">keyboard.cpp</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>fabgl</b></li><li class="navelem"><a class="el" href="classfabgl_1_1_keyboard.html">Keyboard</a></li>
    <li class="footer">Generated on Mon Aug 29 2022 13:52:05 for FabGL by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
  </ul>
</div>
</body>
</html>
